<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>非遗百科 - 探索中国非物质文化遗产</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Microsoft YaHei', Arial, sans-serif;
            background-color: #f5f5f5;
            padding: 0;
            margin: 0;
        }
        
        /* 头部导航栏样式 */
        .header {
            background-color: rgb(135, 73, 73);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
            padding: 20px 25px;
            display: flex;
            flex-direction: column;
            align-items: flex-start;
            gap: 25px;
            position: sticky;
            top: 0;
            z-index: 1001;
        }
        
        /* 首页按钮样式 */
        .home-button {
            background-color: rgba(255, 255, 255, 0.2);
            padding: 8px 15px;
            border-radius: 20px;
            margin-right: 15px;
            transition: all 0.3s ease;
        }
        
        .home-button:hover {
            background-color: rgba(255, 255, 255, 0.3);
        }
        
        body.dark-mode .home-button {
            background-color: rgba(255, 255, 255, 0.1);
        }
        
        body.dark-mode .home-button:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }
        
        /* 模式切换按钮样式 */
        .theme-toggle {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #f0f0f0;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            margin-right: 15px;
        }
        
        .theme-toggle:hover {
            background-color: #e0e0e0;
            transform: rotate(15deg);
        }
        
        .theme-toggle svg {
            width: 20px;
            height: 20px;
            fill: #666;
        }
        
        /* 暗色模式样式 */
        body.dark-mode {
            background-color: #1a1a1a;
            color: #e0e0e0;
        }
        
        body.dark-mode .header {
            background-color: #2a2a2a;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }
        
        body.dark-mode .category-title {
            background-color: #3a3a3a;
            color: #e0e0e0;
        }
        
        body.dark-mode .category-title:hover {
            background-color: #4a4a4a;
        }
        
        body.dark-mode .category-dropdown {
            background-color: #2a2a2a;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        }
        
        body.dark-mode .category-item {
            color: #e0e0e0;
        }
        
        body.dark-mode .category-item:hover {
            background-color: #3a3a3a;
        }
        
        body.dark-mode .user-avatar {
            background-color: #3a3a3a;
        }
        
        body.dark-mode .user-avatar:hover {
            background-color: #4a4a4a;
        }
        
        body.dark-mode .user-avatar.visitor::after {
            color: #999;
        }
        
        /* 类别目录样式 */
        .category-nav {
            position: relative;
            display: flex;
            align-items: center;
        }
        
        .category-title {
            background-color: #f0f0f0;
            padding: 8px 15px;
            border-radius: 20px;
            cursor: pointer;
            font-weight: bold;
            color: #666;
            transition: all 0.3s ease;
            user-select: none;
        }
        
        .category-title:hover {
            background-color: #e0e0e0;
        }
        
        .category-dropdown {
            position: absolute;
            top: 100%;
            left: 0;
            margin-top: 10px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            overflow: hidden;
            z-index: 1000;
            display: none;
            min-width: 150px;
        }
        
        .category-nav:hover .category-dropdown {
            display: block;
        }
        
        .category-item {
            padding: 12px 15px;
            cursor: pointer;
            transition: background-color 0.3s ease;
            color: #333;
            white-space: nowrap;
        }
        
        .category-item:hover {
            background-color: #f5f5f5;
        }
        
        
         
        
        /* 内容容器样式 */
        .content-container {
            max-width: 1200px;
            margin: 20px auto;
            padding: 0 20px;
        }
        
        .content-container h1 {
            margin-bottom: 20px;
            color: #333;
            font-size: 28px;
            text-align: center;
        }
        
        /* 通用内容区块样式 */
        .content-section {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            margin-bottom: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        }
        
        body.dark-mode .content-section {
            background-color: #2a2a2a;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        }
        
        /* 响应式设计 */
        @media (max-width: 768px) {
            .header {
                padding: 10px 15px;
            }
            
            .content-container {
                padding: 0 15px;
            }
            
            .content-container h1 {
                font-size: 24px;
            }
        }
        
        @media (max-width: 480px) {
            .header {
                flex-direction: column;
                align-items: stretch;
                gap: 10px;
            }
            
            .category-nav,
            .user-avatar {
                align-self: center;
            }
            
            .content-section {
                padding: 15px;
            }
        }
        
        /* 用户头像样式 */
        .avatar-container {
            position: relative;
            margin-right: 15px;
        }
        
        .user-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #f0f0f0;
            border: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.3s ease;
            overflow: hidden;
        }
        
        .user-avatar:hover {
            transform: scale(1.1);
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
        }
        
        .avatar-img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        
        .avatar-menu {
            position: absolute;
            top: 100%;
            right: 0;
            margin-top: 10px;
            background-color: white;
            border-radius: 10px;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
            overflow: hidden;
            z-index: 1002;
            display: none;
            min-width: 120px;
        }
        
        .avatar-container:hover .avatar-menu {
            display: block;
        }
        
        .avatar-menu-item {
            display: flex;
            align-items: center;
            padding: 12px 15px;
            color: #333;
            text-decoration: none;
            transition: background-color 0.3s ease;
        }
        
        .avatar-menu-item:hover {
            background-color: #f5f5f5;
        }
        
        .menu-icon {
            margin-right: 10px;
            font-size: 16px;
        }
        
        .menu-text {
            font-size: 14px;
        }
        
        /* 暗色模式适配 */
        body.dark-mode .user-avatar {
            background-color: #3a3a3a;
        }
        
        body.dark-mode .avatar-menu {
            background-color: #2a2a2a;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        }
        
        body.dark-mode .avatar-menu-item {
            color: #e0e0e0;
        }
        
        body.dark-mode .avatar-menu-item:hover {
            background-color: #3a3a3a;
        }
    </style>
    <script src="assets/js/avatarMenu.js"></script>
</head>
<body>
    <!-- 头部导航栏 -->
    <div class="header">
        <!-- 左侧类别目录 -->
        <div style="display: flex; flex-direction: column; align-items: flex-start; gap: 10px;">
            <!-- 首页按钮 -->
            <div class="home-button">
                <a href="index.html" style="display: flex; align-items: center; text-decoration: none; color: white;">
                    <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 5px;">
                        <path d="M12 3L2 12h3v8h6v-6h4v6h6v-8h3L12 3z"/>
                    </svg>
                    <span>首页</span>
                </a>
            </div>
            
            <!-- 类别目录栏 -->
            <div class="category-nav">
                <div class="category-title">非遗类别</div>
            <div class="category-dropdown">
                <div class="category-item" data-category="传统技艺">传统技艺</div>
                <div class="category-item" data-category="传统音乐">传统音乐</div>
                <div class="category-item" data-category="传统舞蹈">传统舞蹈</div>
                <div class="category-item" data-category="传统戏剧">传统戏剧</div>
                <div class="category-item" data-category="传统美术">传统美术</div>
                <div class="category-item" data-category="曲艺">曲艺</div>
                <div class="category-item" data-category="民间文学">民间文学</div>
                <div class="category-item" data-category="传统医药">传统医药</div>
                <div class="category-item" data-category="民俗">民俗</div>
            </div>
        </div>
        
        <!-- 右侧主题切换和用户菜单 -->
        <div style="display: flex; align-items: center;">
            <button class="theme-toggle">
                <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
                    <path d="M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"/>
                </svg>
            </button>
            
            <!-- 用户头像功能已移除 -->
        </div>
    </div>

    <!-- 主内容区域 -->
    <div class="content-container">
        <h1>非遗百科 - 探索中国非物质文化遗产</h1>
        
        <!-- 页面内容将在这里填充 -->
        <!-- 子类页面需要根据自身需求替换这部分内容 -->
        <div class="content-section">
            <h2>页面内容</h2>
            <p>这是一个基础模板页面，子类页面需要根据自身需求替换和填充内容。</p>
        </div>
    </div>

    <script>
        // 类别目录栏点击事件处理
        document.querySelectorAll('.category-item').forEach(item => {
            item.addEventListener('click', function() {
                const category = this.getAttribute('data-category');
                window.location.href = `category.html?type=${encodeURIComponent(category)}`;
            });
        });
        
         
        
        // 为页面标题添加点击事件，跳转到首页
        document.querySelector('h1').addEventListener('click', function() {
            window.location.href = 'waterfall.html';
        });
        
        // 模式切换功能
        function setupThemeToggle() {
            const themeToggle = document.querySelector('.theme-toggle');
            const body = document.body;
            
            // 检查用户之前的主题偏好
            if (localStorage.getItem('theme') === 'dark' || 
                (!localStorage.getItem('theme') && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
                body.classList.add('dark-mode');
            } else {
                body.classList.remove('dark-mode');
            }
            
            // 添加点击事件处理
            themeToggle.addEventListener('click', function() {
                body.classList.toggle('dark-mode');
                
                // 保存用户的主题偏好
                if (body.classList.contains('dark-mode')) {
                    localStorage.setItem('theme', 'dark');
                } else {
                    localStorage.setItem('theme', 'light');
                }
            });
        }
        
        // 初始化主题切换功能
        setupThemeToggle();
    </script>
</body>
</html>